<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="../../template/template.xhtml">
	<ui:define name="content">
		<h:form id="form1">
			<div class="FORM_HEADER">Educational Details</div>
			<h:inputHidden value="#{tutorController.educationDTO.id}" />
			<h:panelGrid columns="3" styleClass="APPLICATION_CONTENT">
				<h:outputLabel value="School Name: " for="schoolName" />
				<h:inputText id="schoolName"
					value="#{tutorController.educationDTO.schoolName}" size="60" />
				<h:message for="schoolName" errorClass="ERROR_MESSAGE" />

				<h:outputLabel value="Standard/Class: " for="standard" />
				<h:inputText id="standard"
					value="#{tutorController.educationDTO.standard}" size="60" />
				<h:message for="standard" errorClass="ERROR_MESSAGE" />

				<h:outputLabel value="Education Medium: " for="medium" />
				<h:inputText id="medium"
					value="#{tutorController.educationDTO.educationMedium}" size="60" />
				<h:message for="medium" errorClass="ERROR_MESSAGE" />

				<h:outputLabel value="University: " for="university" />
				<h:inputText id="university"
					value="#{tutorController.educationDTO.university}" size="60" />
				<h:message for="university" errorClass="ERROR_MESSAGE" />

				<h:outputText value="" />
				<p:commandButton value="Save"
					action="#{tutorController.updateEducation}" ajax="true"
					update="@form">
				</p:commandButton>
			</h:panelGrid>
			<h:dataTable id="educationTable"
				value="#{tutorController.educationDTOList}" var="education"
				styleClass="TABLE_BASIC_COMPOSITION" headerClass="TABLE_HEADER"
				rowClasses="ODD_ROW, EVEN_ROW" cellpadding="8" width="100%">
				<h:column>
					<f:facet name="header">Standard</f:facet>
					<h:commandLink value="#{education.standard}">
						<f:param name="id" value="#{education.id}" />
						<f:ajax listener="#{tutorController.editEducationAjax}"
							render="@form">
						</f:ajax>
					</h:commandLink>
				</h:column>
				<h:column>
					<f:facet name="header">School</f:facet>
					<h:outputText value="#{education.schoolName}" />
				</h:column>
				<h:column>
					<f:facet name="header">University</f:facet>
					<h:outputText value="#{education.university}" />
				</h:column>
				<h:column>
					<f:facet name="header">Medium</f:facet>
					<h:outputText value="#{education.educationMedium}" />
				</h:column>
				<h:column>
					<f:facet name="header">Action</f:facet>
					<h:commandLink value="Remove">
						<f:param name="id" value="#{education.id}" />
						<f:ajax listener="#{tutorController.removeEducation}"
							render="@form" />
					</h:commandLink>
				</h:column>
			</h:dataTable>
		</h:form>

	</ui:define>
</ui:composition>
</html>